<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<%@include file="common.jsp" %>
<script type="text/javascript">
	$(function(){
		$("#nav").tree({
			onClick : function(node){
				console.log(node);
				if($("#tt").tabs("exists",node.text)){
					$("#tt").tabs("select",node.text);
					return;
				}
				$("#tt").tabs("add",{
					title : node.text,
					closable : true,
					content : "我是新来的！",
					href : node.attributes.url
				});
			}
		});
	})
</script>
</head>
<body class="easyui-layout">
        <div class="header" data-options="region:'north'" style="height:50px;overflow: hidden;">
	        	<h1>简单的权限管理系统 <span style="font-size: 14px;">V1.0</span></h1>
		    	<div id="themes">
		    		<label> 欢迎${sessionScope.user.username }【超级管理员】</label>
		    		<a href="sysUser/logout" onclick="return confirm('确定要退出吗，亲~~~~~~');">退出系统</a>
		    		<span class="theme1 active" title="gray"></span>
		    		<span class="theme2" title="black"></span>
		    		<span class="theme3" title="metro"></span>
		    		<span class="theme5" title="default"></span>
		    	</div>
        	
        </div>
        <div data-options="region:'south'" style="height:20px;"></div>
        <div data-options="region:'west'" title="West" style="width:150px;">
        		<ul id="nav" class="easyui-tree" animate="true">
        			<c:forEach items="${sessionScope.permission_list }" var="parent">
        			<c:if test="${parent.parentId == null }">
        			<li>
        				<span>${parent.text }</span>
        				<ul>
        					<c:forEach items="${sessionScope.permission_list}" var="p">
        						<c:if test="${p.parentId != null and p.parentId == parent.id and p.type eq 'menu'}">
		                    		<li data-options="attributes:{url:'${p.url }'}"><span>${p.text }</span></li>
		                    </c:if>
	                    </c:forEach>
	                </ul>
        			</li>
        			</c:if>
        			</c:forEach>
        		</ul>
        </div>
        <div data-options="region:'center'">
	        	<div id="tt" class="easyui-tabs" fit="true">
	        		<div title="首页">
	        			欢迎使用本软件！
	        		</div>
	        		<div title="角色列表" data-options="closable:true,href:'sysRole/index'">
	        		</div>
	        	</div>
        </div>
</body>
</html>